package 第四章作业.O407;

public class Area3 {
    public static void main(String[] args){
        System.out.println(TriangleArea(2,2));
        System.out.println(SquareArea(2));
        System.out.println(RectangleArea(2,3));
    }

    public static double TriangleArea(double a,double b){
        System.out.println("三角形的底为"+a);
        System.out.println("三角形的高为"+b);
        System.out.println("三角形的面积为");
        return a*b/2;
    }
    public static double SquareArea(double a){
        System.out.println("正方形的边长为"+a);
        System.out.println("正方形的面积为");
        return Math.pow(a,2);
    }
    public static double RectangleArea(double a,double b){
        System.out.println("长方形的长为"+a);
        System.out.println("长方形的宽为"+b);
        System.out.println("长方形的面积为");
        return a*b;
    }
}
